local function main (userOb, msgData)
    if not msgData.id then
       return
    end

    local configs = IMPORT_D:query("equipchange")
    if not configs then
        local result = {}
        result.code = 400
        userOb:send_packet("MSGS2CChangeEquipType", result)
        return
    end

    local config = configs[msgData.id]
    if not config then
        local result = {}
        result.code = 401
        userOb:send_packet("MSGS2CChangeEquipType", result)
        return
    end

    --[[
    if userOb:get_equip_type() == msgData.id then
        local result = {}
        result.code = 402
        userOb:send_packet("MSGS2CChangeEquipType", result)
        return
    end
    --]]

    local level = EQUIP_D:get_equip_total_level(userOb)
    if level < config.level then
        local result = {}
        result.code = 403
        userOb:send_packet("MSGS2CChangeEquipType", result)
        return
    end

    ---! 人物换装
    userOb:set_equip_type(msgData.id)

    local result = {}
    result.id = msgData.id
    result.code = 200
    userOb:send_packet("MSGS2CChangeEquipType", result)
end

--注册方法
COMMAND_D:register_command("MSGC2SChangeEquipType",GameCmdType.NONE, main)
